﻿<Window x:Class="SpinningWheel.Demo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:hammer="clr-namespace:Hammer.SpinningWheel;assembly=Hammer.SpinningWheel"
        Title="MainWindow" Height="350" Width="525">
    <UniformGrid Columns="2" Rows="1">
        <hammer:SpinningWheel IsSpinning="{Binding ElementName=spinning, Path=IsChecked, Mode=TwoWay}" 
                              DotRadius="{Binding ElementName=dotRadius, Path=Value, Mode=TwoWay}" 
                              Speed="{Binding ElementName=dotSpeed, Path=Value, Mode=TwoWay}"
                              Radius="{Binding ElementName=radius, Path=Value, Mode=TwoWay}"
                              DotCount="{Binding ElementName=dotCount, Path=Value, Mode=TwoWay}"  
                              SymmetricalArrange="{Binding ElementName=symmetrical, Path=IsChecked}"
                              x:Name="wheel"
                              >
            <hammer:SpinningWheel.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=cwDirection, Path=IsChecked}" Value="True">
                            <Setter Property="hammer:SpinningWheel.Direction" Value="CW" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding ElementName=ccwDirection, Path=IsChecked}" Value="True">
                            <Setter Property="hammer:SpinningWheel.Direction" Value="CCW" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>                
            </hammer:SpinningWheel.Style>
        </hammer:SpinningWheel>

        <StackPanel Orientation="Vertical">
            <TextBlock Margin="4" Text="Radius"/>
            <Slider Margin="4" Minimum="10" Maximum="100" Value="14" x:Name="radius" />
            <TextBlock Margin="4" Text="Dot count"/>
            <Slider Margin="4" Minimum="5" Maximum="30" Value="12" TickFrequency="1" IsSnapToTickEnabled="True" TickPlacement="BottomRight" x:Name="dotCount" />
            <TextBlock Margin="4" Text="Dot radius"/>
            <Slider Margin="4" Minimum="1" Maximum="10" Value="3" x:Name="dotRadius" />
            <TextBlock Margin="4" Text="Speed (1 / second)"/>
            <Slider Margin="4" Minimum="0.1" Maximum="3" Value="1" x:Name="dotSpeed" />
            <TextBlock Margin="4" Text="Direction"/>
            <StackPanel Orientation="Horizontal">
                <RadioButton Margin="4" GroupName="direction" x:Name="cwDirection" Content="CW" IsChecked="True" />
                <RadioButton Margin="4" GroupName="direction" x:Name="ccwDirection" Content="CCW" />
            </StackPanel>
            <CheckBox x:Name="symmetrical" Content="Symmetrical arrange?" Margin="4" IsChecked="True"/>
            <CheckBox x:Name="spinning" Content="Spinning?" Margin="4"/>
        </StackPanel>
    </UniformGrid>
</Window>
